/*
 题意：只有一个电插头和n个电插板，要求计算最多能连接多少电器。
 */
package com.yuan.algorithms.practice201504;

import java.util.Scanner;

public class 电插头 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			int c = sc.nextInt();
			for (int i = 0; i < c; i++) {
				int n = sc.nextInt();
				int sum = 0;
				for (int j = 0; j < n; j++) {
					sum += sc.nextInt();
				}
				System.out.println(sum-n+1);
			}
		}

	}

}
